<%--
  Created by GHW.
  Date: 2019/12/17
  Time: 9:50
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>游戏管理</title>
    <c:set value="${pageContext.request.contextPath}" var="ctx"/>
    <link rel="stylesheet" href="${ctx}/css/bootstrap.css" type="text/css">
    <link rel="stylesheet" href="${ctx}/css/game2.css">

</head>
<body>
<ol class="breadcrumb">
    <li class="active"><a href="findAllGameByPage">游戏列表</a></li>
</ol>

<form action="addGame" method="post" enctype="multipart/form-data">
    <div class="wrapper">
        <div class="form-header">添加游戏<i class="fa fa-times close"></i></div>

        <div class="form-grp">
            <label for="name">游戏名字：</label>
            <input type="text" name="name" id="name" required placeholder="游戏名字">
            <span id="u1"></span>
        </div>

        <div class="form-grp">
            <label for="developer">开发商：</label>
            <input type="text" name="developer" id="developer" required placeholder="开发商">
        </div>

        <div class="form-grp">
            <label for="price">游戏原价：</label>
            <input type="text" name="price" id="price" required placeholder="游戏原价">
        </div>

        <div class="form-grp">
            <label for="discountprice">折后价：</label>
            <input type="text" name="discountprice" id="discountprice" required placeholder="折后价">
        </div>

        <div class="form-grp">
            <label for="img">游戏图片：</label>
            <input type="file" name="img" id="img" alt="" placeholder="图片上传" required>
        </div>

        <div class="form-grp">
            <label for="platform">运行平台：</label>
            <input type="text" name="platform" id="platform" required placeholder="运行平台">
        </div>

        <div class="form-grp">
            <label for="tag">游戏标签：</label>
            <select id="tag" name="tag" required>
                <option value="射击">射击</option>
                <option value="动作">动作</option>
                <option value="冒险">冒险</option>
                <option value="赛车">赛车</option>
                <option value="角色扮演">角色扮演</option>
                <option value="独立">独立</option>
                <option value="休闲">休闲</option>
                <option value="科幻">科幻</option>
            </select>
        </div>

        <div class="form-grp">
            <label for="description">描述：</label>
            <input type="text" name="description" id="description" required placeholder="描述">
        </div>
        <div class="form-grp">
            <input type="submit" value="提交" class="button buttonBlue">
        </div>
        <div class="form-grp">
            <span id="u2"></span>
        </div>
    </div>

</form>
<script src="${ctx}/js/jquery-3.4.1.min.js"></script>
<script src="${ctx}/js/bootstrap.js"></script>
<script type="text/javascript">
    $(function () {
        var msg = '${msg}';
        if (msg === "库中已有此游戏") {
            $("#u1").append("<span style='color: red;font-size: 16px'>" + msg + "<span>")
        }
        var success = '${success}';
        if (success === "添加成功") {
            $("#u1").append("<span style='color: green;font-size: 16px'>" + success + "<span>")
        }
    });

</script>
</body>
</html>
